package com.woniu.woniuproject.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016102500755656";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCQ5chzsZ6k3EPgZaqWnd+H/morfXTCcNhU8m6lJZzLJ+/cLxUkT1CvwD/+LIBB4cXexPPdSVZ8ccHMF/72aR/SSNoB/TeaBOo6JhwzY7iFks4fq9gYzDWBbP4sBUngp2Lrxp8CIxmKV13CzZscpvxQ3r1gcnJMo1oeUC8o+jyBV5S4IyGg4fpuUzJtqiNWqw1qagLwGz3KVt42o8BzrdEb3VfoepFBw1VMXtM1uObTmeHUeD6QSik9cGJHDu0wxT0xL4OW2sn+UjjZYc7OStSyZwrYNPzuLjgtHfSfDvWifwTa8v6TL+u3FYlf7XqGY4zoWcbFwaFo98Vz9E5E8NNzAgMBAAECggEAKE4iwjvoO0eiAeuF1ju4ECYu9kYBkoy9QHPnXzzlLoW/bOoT4XPGp/y8UEGks67P0bXLeASMcDVciR8rpvN7DI2DRwZezxMK7H3pXkog69b4S0sL42n6gDQHR8t4z2sAU0F+vaNx2U+QHz3+Jaw1h3FOEGQFc1gFG2WGmMlyxy9gYr7WdezqNG2RATlOsh02zDWGFyjpJQG43eSXLiVEwSx8LwZGqsXVp+JPIT3LTGJBefD2Na3fIoxPNKSU9yq9X81Kff/Svv8VztC1VZCw8+LzI3p0bIndda7JpKhadLUxf4RvYHxlFSzIMj9w6H6t5aD8VSLHZ99N5gjErBV50QKBgQDBYXfATU6bBehtu9odCl6U/xH6lqYdpOBRl3k3RyoU6d+Vcy+ELorZZ0NK+qGfJ7rxDQwEdcpjjr5QUhhVZgkB4QZfdw+CKPaat2tqJJ4J7elDI0FnLC0oFdN3lhNtJy9zSCainsrk6YSbGjBSbO/EB6nssImnzfQQdcR3wG4ANQKBgQC/0T7swrgUJdRSZz2zLEEca0h/QRCv8hUYGaB67JXk1DI0UvAkdKR3i67+yU2lY/MxNFxM4j4YwO5RMTW065JK1jtdUP7dAzIm8Fspgr99YjilqT7bDx+B9MxkxuWx68xn9/3VWwz0zmHsoQWoSGrKsuxSF0DXq0QcRdoVMVHKBwKBgGZsEDf6+hIje+p631gYQOYbftNBbTQwOlscpif/+irff/sw6c7Rs9rX1Y1l16prKZk4ds/57zrxxJzYDmlUxJqJK43uink+5vYlBbBPOqE5sB1OE/roK/aaMMma5Ckg4wHlCgmBnybFA+X+Ze+SIR+ri3WAPzhwXb9GEMv4UIqtAoGAAPXDItw2n6Mw1Ni/bk4iZUoEKt7gfoDvqhc2vmbAuUx2k9x2ZzhOOmrwjUXkpZdCeFSSwa/AL8+HYdClPCqRqN45ndXx8Jk7fwZk7mhBHReIwQt/zQjeV4AqJbb5H1LWyw5qrs6t2evOgaisppL2Nd1/YUnMgUfSJ3ISDVkZ17ECgYAQNuKKxgADQYfEx6UIMQw15viTfZRIkfk4Ubcj9Ewk44IFig7kKmmWwqxqlIXiwW222wz257we2+zz6X2g+B88k6cA5c+jOc3zPXirfDminWE2X1vFRhcKnvxX9woZwLwyyL5fiahXZyYNCIx0uajL3hDjD0sOlh1VigkNfeGbPA==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkOXIc7GepNxD4GWqlp3fh/5qK310wnDYVPJupSWcyyfv3C8VJE9Qr8A//iyAQeHF3sTz3UlWfHHBzBf+9mkf0kjaAf03mgTqOiYcM2O4hZLOH6vYGMw1gWz+LAVJ4Kdi68afAiMZilddws2bHKb8UN69YHJyTKNaHlAvKPo8gVeUuCMhoOH6blMybaojVqsNamoC8Bs9ylbeNqPAc63RG91X6HqRQcNVTF7TNbjm05nh1Hg+kEopPXBiRw7tMMU9MS+DltrJ/lI42WHOzkrUsmcK2DT87i44LR30nw71on8E2vL+ky/rtxWJX+16hmOM6FnGxcGhaPfFc/RORPDTcwIDAQAB/uim9uRaXB8Q4OnNRYZa9MJnhZ9UvP61gxWUGGD3iK8D56XDkgj2HM5EO/XxVZ0u74xRDmHvFH/yKKiJd0V40xL4XKqUQZ1iaTcmMawkEjodFBWSHNb7eL013RPobdKcd9scWFNdhntupJ9cTelcrtIVSGdl6mx0QH2tWh07V9iq6c1Uj/Ds489gT/ASKeunvIw/QKO50ZJQwtxsQvUFyxI2yEx6XW8dWZObwfLeQGj9m1WQdspfTf6z9734tBo6A7G257yd/CbjfTIDhgHQsvPovs0BXvplELUnNQwaQD60OIA0Xwpmyl1jHwKCtGwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/webtext/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

